Skip to content

Comments

feat(assert): date comparison assertions with format auto-detection#585

Merged
Chemaclass merged 12 commits intomainfrom
feat/date-comparison-assserts
Feb 22, 2026
Merged

feat(assert): date comparison assertions with format auto-detection#585
Chemaclass merged 12 commits intomainfrom
feat/date-comparison-assserts

Conversation

@Chemaclass
Copy link
Member

@Chemaclass Chemaclass commented Feb 6, 2026

Summary

  • Add date comparison assertions: assert_date_equals, assert_date_before, assert_date_after, assert_date_within_range, assert_date_within_delta
  • Auto-detect multiple date formats with portable GNU/BSD support:
    • Epoch seconds, ISO 8601 date (2023-11-14), ISO 8601 datetime (2023-11-14T12:00:00), UTC Z suffix (2023-11-14T12:00:00Z), timezone offset (2023-11-14T12:00:00+0100), space-separated datetime (2023-11-14 12:00:00)
    • Mixed formats supported in the same assertion call
  • Split Windows CI unit c job into unit c and unit coverage to reduce timeout risk
  • Fix flaky assert_duration test on Windows CI (threshold too tight for slow runners)

Add assert_date_equals, assert_date_before, assert_date_after,
assert_date_within_range and assert_date_within_delta using epoch
seconds for fully portable date comparisons.
@Chemaclass Chemaclass added the enhancement New feature or request label Feb 6, 2026
@Chemaclass Chemaclass self-assigned this Feb 6, 2026
@Chemaclass Chemaclass marked this pull request as draft February 6, 2026 12:45
@Chemaclass Chemaclass force-pushed the main branch 2 times, most recently from e1804db to 526f6ec Compare February 9, 2026 23:48
Chemaclass and others added 7 commits February 10, 2026 01:36
Cover boundary conditions: equal values for before/after,
below-range failure for within_range, and negative direction
for within_delta.
Date assertions now accept ISO 8601 strings (2023-11-14,
2023-11-14T12:00:00) in addition to epoch seconds. A new
bashunit::date::to_epoch helper auto-detects the format and
converts to epoch, with GNU/BSD date portability.
Keep both date assertions (branch) and duration/json/format assertions (main).
Update snapshots and rebuild binary to include all new assertions.
@Chemaclass Chemaclass force-pushed the feat/date-comparison-assserts branch from 4d9361d to feb5630 Compare February 22, 2026 01:05
@Chemaclass Chemaclass marked this pull request as ready for review February 22, 2026 01:19
@Chemaclass Chemaclass changed the title Date comparison assserts feat(assert): date comparison assertions with format auto-detection Feb 22, 2026
@TypedDevs TypedDevs deleted a comment from github-actions bot Feb 22, 2026
@Chemaclass Chemaclass merged commit aec3eb3 into main Feb 22, 2026
40 of 41 checks passed
@Chemaclass Chemaclass deleted the feat/date-comparison-assserts branch February 22, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant